<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Quảng Lý Sản Phẩm</title>
        <link href="search.css" rel="stylesheet" type="text/css">
        <link href="styles.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <jsp:include page="admin-header.jsp" />
		<div class="admin-table1" id="xemsp">
            <h2>Thông Tin Sản Phẩm</h2>
              <table class="table-bordered">
             <thead>
		 <tr>
            <th>Tên Sản Phẩm</th>
            <th>Giá Bán</th>
            <th>Thương hiệu </th>
            <th>Discount</th>
            <th>Hình</th>
            <th>Chỉnh Sửa</th>
		</tr>
            <tbody style="border: 1px solid #333;">
                <c:forEach items="${list}" var="list" >
                    <tr style="border: 1px solid #333;">
                        <td><a href = "ctsanpham.jsp?masp=${list.masp}">${list.tensp}</a></td>
                        <td>${list.giaban}</td>
                        <td>${list.thuonghieu}</td>
                        <td>${list.discount}</td>
                        <td><a href = "ctsanpham.jsp?masp=${list.masp}"><img width="300px" border = 0 src=${list.urlhinh}></a></td>
                        <td><a href = "adminsuasanpham?masp=${list.masp}">Sửa</a></td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
        <div class="trang">
            <c:if test="${currentPage != 1}">
                <a href="admintimsanpham?page=${currentPage - 1}" >Trước</a>
            </c:if>
            <c:forEach begin="1" end="${noOfPages}" var="i">
                <c:choose>
                    <c:when test="${currentPage eq i}">
                        <a>${i}</a>
                    </c:when>
                    <c:otherwise> <a href="admintimsanpham?name=${keyword}&page=${i}">${i}</a> </c:otherwise>
                </c:choose>
            </c:forEach>
            <c:if test="${currentPage lt noOfPages}">
                <a href="admintimsanpham?page=${currentPage + 1}">Tiếp</a>
            </c:if>
        </div>
    </body>
</html>